package graduation.claf;

import graduation.claf.inteceptors.ProtalLoginCheckInteceptors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.ArrayList;
import java.util.List;

@SpringBootConfiguration
public class SpringBootConfig implements WebMvcConfigurer {

    @Autowired
    ProtalLoginCheckInteceptors protalLoginCheckInteceptors;

    //注册拦截器
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//        List<String> exclueUrl = new ArrayList<>();
//        exclueUrl.add("/portal/user/login.do");
//        exclueUrl.add("/portal/user/register.do");
//        registry.addInterceptor(protalLoginCheckInteceptors)
//                .addPathPatterns("/portal/user/**")
//                .excludePathPatterns(exclueUrl);
    }
}
